package com.jgp.security.shiro.exception;

import com.jgp.common.exception.ErrorCode;
import org.apache.shiro.authc.AuthenticationException;

/**
 * 项目   jgp-cloud-parent
 * 作者   loufei
 * 时间   2019-06-05
 */
public class SecurityException extends AuthenticationException {
    private String module;
    private String code;
    
    private static final String PREFIX = "平台-安全模块";
    
    public SecurityException(ErrorCode code) {
        this.module = PREFIX;
        this.code = code.getCode();
    }
    
    public SecurityException(ErrorCode code, Exception e) {
        super(e);
        this.module = PREFIX;
        this.code = code.getCode();
    }
    
    public SecurityException(String module, ErrorCode code) {
        this.module = module;
        this.code = code.getCode();
    }
    
    public SecurityException(String module, ErrorCode code, Exception e) {
        this.module = module;
        this.code = code.getCode();
    }
    
    public String getModule() {
        return module;
    }
    
    public void setModule(String module) {
        this.module = module;
    }
    
    public String getCode() {
        return code;
    }
    
    public void setCode(String code) {
        this.code = code;
    }
}
